package com.baturu.mybatisminus.base;

import java.io.Serializable;

/**
 * Pageable简单实现
 * @author huangbin
 **/
public class Page implements Pageable, Serializable{

    private static final long serialVersionUID = -7330463009950079897L;

    /**
     * 从0开始
     */
    private int page;
    private int size;


    public static Page of(int page, int size) {
        return new Page(page, size);
    }

    public static Page unpaged() {
        return null;
    }


    protected Page(int page, int size) {
        this.page = page;
        this.size = size;
    }


    @Override
    public int getPageNum() {
        return page;
    }

    @Override
    public int getPageSize() {
        return size;
    }

    @Override
    public String getLimitString() {
        return " limit " + getOffset() + "," + getPageSize();
    }
}
